
package carmadness.view;

import java.awt.Color;

import carmadness.model.Bunny;

/**
 * Nyuszit grafikus felületen megjelenítő osztály.
 * 
 * @author arpi
 * @version 1.0
 * @created 10-Apr-2010 2:32:39 PM
 */
public class GraphicBunnyRenderer extends GraphicRenderer
{
	/**
	 * A renderelést végző metódus.
	 * 
	 * @param object
	 */
	public void render( Object object )
	{

		Bunny bunny = (Bunny)object;

		if ( bunny.isOn() )
		{
			pushTransform();

			graphics.translate( -35, 35 );

			graphics.setColor( new Color( 200, 200, 200 ) );
			graphics.fillPolygon( new int[] {3, 1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 17, 15 }, new int[] {14, 11, 3, 1, 1, 3, 8, 3, 1, 1, 3, 11, 14 }, 13 );

			graphics.setColor( new Color( 100, 100, 100 ) );
			graphics.drawPolygon( new int[] {3, 1, 1, 3, 5, 7, 9, 11, 13, 15, 17, 17, 15 }, new int[] {14, 11, 3, 1, 1, 3, 8, 3, 1, 1, 3, 11, 14 }, 13 );

			graphics.setColor( new Color( 200, 200, 200 ) );
			graphics.fillOval( 2, 11, 15, 12 );

			graphics.setColor( new Color( 100, 100, 100 ) );
			graphics.drawOval( 2, 11, 15, 12 );

			graphics.drawOval( 7, 17, 5, 4 );

			popTransform();
		}

	}
}
